package com.example.mapper;


import com.example.pojo.dev.fmDevInfo;
import com.example.pojo.msgDevice;

import com.example.pojo.subscription.subscriptionContent;
import com.example.pojo.subscription.subscriptionMessage;
import com.example.pojo.subscription.userSubscription;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @BelongsProject: parem-yunstiu
 * @BelongsPackage: com.yunsitu.mapper
 * @Author: dyz
 * @CreateTime: 10:52
 * @Version: 1.0
 */
@Repository
public interface AlarmMapper {
    //查询报警报是否有这个设备的报警信息
    msgDevice select(@Param("dbid")Integer dbid,
                     @Param("alarmDescription")String alarmDescription , @Param("modelId") String modelId,
                     @Param("alarmGrade")String alarmGrade);

    void insertAlarm(msgDevice msgDevice);

    //修改这个设备的报警
    int update(msgDevice alarm);
    int updatetime(msgDevice alarm);

    //查询设备表找到相对应内容
    fmDevInfo selectbyobjectId(@Param("objectId") String objectId);

    int delectbyid(@Param("Id") int Id);

    //删除小铃铛
    int delectmessageRemindbyid(@Param("Id") int Id);
    //删除保养变量时间
    int delectomdroolsdbyid(@Param("dbid") int dbid);
    int delectomdroolsdbyname(@Param("name") String name);


    //查询全部空间订阅

    List<userSubscription> selectDevicebydeviceSafety(@Param("subsystemBelong") String subsystemBelong, @Param("systemBelong") String systemBelong);

    //查询是否监控wx
    subscriptionContent selectContentbysubscribers( @Param("pid") int pid, @Param("type") String type);


    //查询全部设备订阅

    List<userSubscription> selectSpacebystorey(@Param("storey") String storey);

    //添加消息记录

    int addsubscriptionMessage(subscriptionMessage subscriptionMessage);

    String selectbysubscribers(@Param("userName") String userName);


    //添加运行时长设备的报警
    void insertOmAlarm(msgDevice msgDevice);


    //查询报警报是否有这个设备的报警信息
    List<msgDevice> selectbyOm(@Param("dbid")Integer dbid, @Param("statusDescription")String statusDescription, @Param("position")String position);


    List<msgDevice> selectby(@Param("systemBelong") String systemBelong, @Param("subsystemBelong")
            String subsystemBelong, @Param("floor")String floor , @Param("environment")String environment);

    List<userSubscription> selectall();


    //根据dbidmodelid chaxun
    msgDevice selectbydbidandmodelid(@Param("dbid")Integer dbid, @Param("modelId") String modelId);
    List<msgDevice> selectbydbidandmodelidlist(@Param("dbid")Integer dbid, @Param("modelId") String modelId);
    //模糊查询
    List<msgDevice> selectbyname(@Param("name")String name);
    List<msgDevice> getbyalarmStatusandalarmCount();
    List<msgDevice> getbyalarmStatusandmsgType();

    //通过dbid modelid 变量名查询
    msgDevice getbydbIdmodelIDandvar(@Param("dbid")Integer dbid, @Param("alarmVar") String alarmVar, @Param("modelId") String modelId);
}
